import axios from 'axios'
import qs from 'qs'

// const BASEURL = ''
// const BASEURL = 'http://127.0.0.1:9089'
const BASEURL = 'http://jssy.edik.cn'

export function get (params) {
  return axios.get(BASEURL + params.url, {
    params: params.data
  }).then((response) => {
    params.success(response.data)
  }).catch((error) => {
    params.error(error)
  })
}

export function post (params) {
  return axios.post(BASEURL + params.url, qs.stringify(params.data)).then((response) => {
    params.success(response.data)
  }).catch((error) => {
    params.error(error)
  })
}
